// $Id: cons.cpp 2 2009-09-02 08:47:42Z joseph2002 $
/*
 * Copyright 2009 Joseph Wu
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 *
 * For more information, see http://xpcomplus.sourceforge.net
 */

#include <boost/test/unit_test.hpp>
#include <xpcom/uuid.hpp>

namespace xpcom {
namespace {

struct A
{
    A()
    {
    }

    A(int) : id_()
    {
    }

    A(double)
    {
        id_ = uuid::nil;
    }

    uuid id_;
};
}
}

BOOST_AUTO_TEST_CASE(test_cons)
{
    using namespace xpcom;

//    uuid id1;
//    BOOST_CHECK(!id1.is_nil());

    uuid* id2 = new uuid();
    BOOST_CHECK(id2->is_nil());
    delete id2;

//    uuid* id3 = new uuid;
//    BOOST_CHECK(!id3->is_nil());
//    delete id3;

    uuid id4 = { 0 };
    BOOST_CHECK(id4.is_nil());
    uuid id5(id4);
    BOOST_CHECK(id5.is_nil());

//    A a1;
//    BOOST_CHECK(!a1.id_.is_nil());

    A a2(9);
    BOOST_CHECK(a2.id_.is_nil());

    A a3(9.0);
    BOOST_CHECK(a3.id_.is_nil());
}
